/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 查询用户中心分页列表 GET /user_center */
export async function userCenterGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelUserCenterModel_>(
    '/user_center',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 新增认证申请 POST /user_center/application */
export async function userCenterInsert({
  body,
  options,
}: {
  body: API.InsertApplicationModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user_center/application', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户收藏分页列表 GET /user_center/favorite */
export async function userCenterGet3({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelUserFavoriteModel_>(
    '/user_center/favorite',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 收藏/取消收藏 GET /user_center/favorite */
export async function userCenterFavorite({
  params,
  options,
}: {
  // 使用params参数，通过GET请求实现收藏/取消收藏
  params: API.UserCenterFavoriteParams & { action?: 'add' | 'remove' };
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user_center/favorite', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

// 注意：取消收藏功能已合并到 userCenterFavorite 中，通过 action: 'remove' 参数实现

/** 查询检测项点分页列表 GET /user_center/item_point */
export async function userCenterGet7({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelItemPointModel_>(
    '/user_center/item_point',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询检测项点类别列表 GET /user_center/item_point/category */
export async function userCenterGet6({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListItemPointCategoryModel_>(
    '/user_center/item_point/category',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 用户中心登录 POST /user_center/login */
export async function userCenterLogin({
  body,
  options,
}: {
  body: API.MobileLoginModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelUserCenterLoginModel_>('/user_center/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户中心产品分页列表 GET /user_center/product */
export async function userCenterGet2({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelCenterProductModel_>(
    '/user_center/product',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询用户中心产品类别列表 GET /user_center/product/category */
export async function userCenterGetCategory({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListCenterProductCategoryModel_>(
    '/user_center/product/category',
    {
      method: 'GET',
      ...(options || {}),
    }
  );
}

/** 查询用户中心产品详情 GET /user_center/product/detail */
export async function userCenterGetProduct({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetProductParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelCenterProductDetailModel_>(
    '/user_center/product/detail',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询质量科普分页列表 GET /user_center/science */
export async function userCenterGet5({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelScienceModel_>(
    '/user_center/science',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询质量科普类别列表 GET /user_center/science/category */
export async function userCenterGet4({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListScienceCategoryModel_>(
    '/user_center/science/category',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询质量科普详情 GET /user_center/science/detail */
export async function userCenterGetScience({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterGetScienceParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelScienceModel_>(
    '/user_center/science/detail',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 用户中心请求短信 POST /user_center/sms */
export async function userCenterRequestSms({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserCenterRequestSmsParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user_center/sms', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
